<?php

namespace Entity;
use\Abstraction;

class Sequencepqp extends Abstraction\PqpAbstract
{
    protected function doConstruct()
    {
        $this->name = 'seq';
        
        $this->struct = array();
        $this->struct[0] = '<tr class="%s">';
        $this->struct[1] = '<td class="%s">';
        $this->struct[2] = '%s</td>';
        $this->struct[3] = '<td class="%s">';
        $this->struct[4] = '<div><pre>%s</pre>';
        $this->struct[5] = '<em>%s</em>&nbsp;';
        $this->struct[6] = '%s</div></td></tr>';
    }
    
    protected function translate($data, $alt)
    {
        switch($data['type'])
        {
            case 'log':
                return array( 
                                'log-'.$data['type'], 'type', $data['type'], $alt, $data['data'],'',''
                              );
            
            case 'memory':
                $sizer = new Sizer;
                return array( 
                                'log-'.$data['type'], 'type', $data['type'], $alt, $sizer($data['data']['data']), ucfirst($data['data']['dataType']), $data['data']['name'],
                              );
            
            case 'speed':   
                $tsizer = new TimeSizer;
                return array( 
                                'log-'.$data['type'], 'type', $data['type'], $alt, $tsizer($data['data']['data']), $data['data']['name'],'',
                              );
        }
        
    }
}

